﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JTicket.BLL;

namespace JTicket.UI
{
    public partial class JT_CardEditePassWord : RoleBase
    {
        private readonly BLL.D_OperInfo bllOper = new BLL.D_OperInfo();
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Button2.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(Button2, "Click") + ";this.disabled=true; this.value='读取中...';");
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
            string str = Printer.CardBusiness.GetCadID();
            if (str != "系统未连接读卡器")
            {
                this.t1.Text = str;
                if (t1.Text != "")
                {
                    Model.D_KaInfo ka = DAL.D_KaInfo.GetModel(this.t1.Text);
                    if (ka.pusername != null)
                        this.t2.Text = ka.pusername;
                    else
                        Common.JsMsg.Alert("未查询到卡信息");
                }
            }
            else
                Common.JsMsg.Alert("系统未连接读卡器");
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string OperCode = bllOper.Oper().OperCode;

            string result = DAL.D_KaInfo.KaOperate(this.t1.Text, Common.DESEncrypt.Encrypt(this.t5.Text), OperCode, Common.DESEncrypt.Encrypt(this.t3.Text), "", "", "", "", "", "卡密码修改");
            Common.JsMsg.Alert(result);

        }
    }
}